<%@page import="com.bean.UserBean"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
	@SuppressWarnings("unchecked")
	ArrayList<UserBean> list = (ArrayList<UserBean>)request.getAttribute("userList"); 
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'statistic.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type = "text/css" href="CSS/statistic.css">
</head>

<body >
<div class="title" style="width: 95%">
	<h1>ALL USERS INFORMATIONS</h1>
	<table align="center">
	<tr  align="center" style="font-family: cursive;" height="30px">
	  <td align="center">
		<a href="StatisticServlet?option=top">TOP 10</a>
		<font color="red"> |</font>		
		<a href="StatisticServlet?option=in">IN</a>
		<font color="red"> |</font>
		<a href="StatisticServlet?option=out">OUT</a>
		<font color="red"> |</font>
		<a href="StatisticServlet?option=tools">ALL Tools</a>
		<font color="red"> |</font>
		<a href="StatisticServlet?option=users">ALL Users </a>
	 </td>
	  <td width="10%">
	 	<input type = "button" value = "SHEET" onclick="location.href='SheetServlet?sheet=users'">
	 </td>
	</tr></table>
</div>
<table width="95%" id="mytab"  border="1" class="t5">
  <thead>
  <tr>
    <th width="4%">num</th>
    <th width="8%">userID</th>
    <th width="10%">firstName</th>
    <th width="10%">lastName</th>
    <th width="7%">gender</th>
    <th width="15%">email</th>
    <th width="5%">age</th>
    <th width="9%">phone</th>
    <th width="10%">date</th>
    <th width="18%">remark</th>
   </tr>
  </thead>
 <tbody style="overflow: scroll; height: 5px">
<%
	String userID = "";
	String firstName = "";
	String lastName = "";
	String gender = "";
	String status = "";
	String email = "";
	String age = "";
	String phone = "";
	String date = "";
	String remark = "";
	int num = 0;
	if(null != list && list.size()!=0)
	{
		Iterator<UserBean> iter = list.iterator();
		while(iter.hasNext())
		{
			UserBean userBean = iter.next();
			userID =userBean.getUserID();
		    firstName =userBean.getFirstname();
			lastName =userBean.getLastname();
			gender =userBean.getGender();
			email =userBean.getEmail();
			age =userBean.getAge();
			phone =userBean.getPhone();
			date =userBean.getDate().toString();
			remark =userBean.getRemark();
			num++;
%>
  			<tr <%if(num%2!=0){ %>class="a1"<%} %>>
  			<td><%=num %></td>
  			<td><%=userID %></td>
   			<td><%=firstName %></td>
    		<td><%=lastName %></td>
   			<td><%=gender %></td>
   			<td><%=email %></td>
   			<td><%=phone %></td>
    		<td><%=age %></td>
   			<td><%=date %></td>
   			<td><%=remark %></td>
  			</tr>
<%	 	}
	}
%>
 </tbody>
</table>

</body>
</html>
